package edu.sctu.practice.class01.zhoumengxue.assign.assign03.assign03_1;

/**
 * Created by ASUS on 2015/10/22.
 */
public class Rectangle extends GeometricObject {

    private double rectangleArea;
    private double rectanglePerimeter;

    public Rectangle(String color, double width, double length) {
        super(color, width, length);
    }


    @Override
    public double findArea() {
        rectangleArea = length * width;
        System.out.println("矩形的面积：" + rectangleArea);
        return rectangleArea;
    }


    @Override
    public double findPerimeter() {
        rectanglePerimeter = 2 * (length + width);
        System.out.println("矩形的周长：" + rectanglePerimeter);
        return rectanglePerimeter;
    }

}
